<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            border: 1px solid #d9d9d9;
            color: #aaa;
            outline: none;
        }
        
        .text-ipt {
            border: 1px solid #ffd6db;
            color: #888;
            outline: none;
        }
    </style>
</head>

<body>
    <input type="text" value="邮箱/ID/手机号">
    <script>
        var ipt = document.querySelector('input');
        ipt.onfocus = function() {
            this.value = '';
            this.className = 'text-ipt'
        }
        ipt.onblur = function() {
            if (this.value == '') {
                this.value = '邮箱/ID/手机号';
                this.className = '';
            }

        }
    </script>
</body>

</html>